//
//  YHEnemyShip.h
//  ThunderWarriors
//
//  Created by mac on 13-6-23.
//
//

#ifndef __ThunderWarriors__YHEnemyShip__
#define __ThunderWarriors__YHEnemyShip__

#include "iostream.h"
#include "YHCollideSprite.h"
using namespace std;

enum YHEnemyActionType { //敌机运动路线类型
    YHEnemyActionType0 = 0,
    YHEnemyActionType1 = 1,
    YHEnemyActionType2 = 2,
    YHEnemyActionType3 = 3,
    YHEnemyActionType4 = 4          
    };

typedef struct _EnemyType{
    int velocityx;
    int velocityy;
    int bulletSpeed;
    int bulletPowerValue;
    int hp;
    int scoreValue;
    YHEnemyActionType actionType;
    string enemyTextureName;
}YHEnemyType;

static const YHEnemyType YHEnemyTypes[5]={{0,-50, -500, 1, 5, 100, YHEnemyActionType0, "E0.png"},
    {0,-50, -600, 1, 7, 200, YHEnemyActionType0,"E1.png"},
    {0,-50, -600, 1, 7, 200, YHEnemyActionType0,"E2.png"}
};

class YHEnemyShip: public YHCollideSprite {
public:
    YHEnemyShip();
    ~ YHEnemyShip();
    void destroy();
    void hurt() ;
    CCRect getCollideCrect();
    virtual bool init();
    virtual bool initWithEnemyType(YHEnemyType enemyType);
    virtual void udpate(float dt);
    virtual void shoot(float t);
    inline bool getIsActive(){return m_isActive;}
    static YHEnemyShip* createWithEnemyType(YHEnemyType enemyType);
    
    CREATE_FUNC(YHEnemyShip);
    CC_SYNTHESIZE(YHEnemyType, m_enemyType, EnemyType);
    
private:
    bool m_isActive;
};

#endif /* defined(__ThunderWarriors__YHEnemyShip__) */
